package one.stand.feign;

import one.stand.entity.TokenEntity;
import one.stand.fallback.LoginFallBack;
import one.stand.model.ResultModel;
import one.stand.request.WxLoginRequest;
import one.stand.response.BusinessCardResponse;
import one.stand.response.LoginResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author Administrator
 */
@Component
@FeignClient(value = "login-service", fallback = LoginFallBack.class, decode404 = true)
public interface LoginFegin {

    /**
     * 登陆信息验证
     *
     * @param token
     * @return
     */
    @PostMapping("home/getLoginInfo")
    ResultModel<TokenEntity> getLoginInfo(@RequestBody String token);

    /**
     * 微信登陆
     *
     * @param request
     * @return
     */
    @PostMapping("home/loginByWeixin")
    ResultModel<LoginResponse> loginByWeixin(@RequestBody WxLoginRequest request);

    /**
     * 登陆验证
     *
     * @param token
     * @return
     */
    @PostMapping("home/loginVerification")
    ResultModel<Boolean> loginVerification(@RequestBody String token);

    @PostMapping("home/userInfo")
    ResultModel<BusinessCardResponse> userInfo(Long userId);


}
